import request from '@/utils/request'

// 查询应收账款列表
export function listBizCustomerAccount (query) {
  return request({
    url: '/biz/bizcustomeraccount/list',
    method: 'get',
    params: query
  })
}
// 删除收款单
export function delBizCustomerAccount (id) {
  return request({
    url: `/biz/bizcustomeraccount/${id}`,
    method: 'delete',
  })
}
// 删除收款单明细
export function delBizCustomerAccountDetail (ids) {
  return request({
    url: `/biz/bizcustomerpayable/detail/${ids}`,
    method: 'delete',
  })
}
export function listAllBizCustomerAccount (query) {
  return request({
    url: '/biz/bizcustomeraccount/allList',
    method: 'get',
    params: query
  })
}

// 查询对账信息
export function getBizCustomerDetailInfo (accountCode) {
  return request({
    url: '/biz/bizcustomeraccount/detailAccount/' + accountCode,
    method: 'get'
  })
}

// 查询收款信息
export function getBizPaymentDetailInfo (accountCode) {
  return request({
    url: '/biz/bizPayment/' + accountCode,
    method: 'get'
  })
}
// 查询收款明细信息
export function getBizPaymentDetail (param) {
  return request({
    url: '/biz/bizcustomeraccount/detailAccount/' + param.accountCode + '/' + param.type,
    method: 'get'
  })
}

// 新增付款单
export function addBizCustomerAccount (data) {
  return request({
    url: '/biz/bizcustomeraccount',
    method: 'post',
    data: data
  })
}
// 新增付款单
export function addBizCustomerAccountDetail (data) {
  return request({
    url: '/biz/bizcustomeraccount',
    method: 'put',
    data: data
  })
}
// 结算
export function updateAccountType (data) {
  return request({
    url: '/biz/bizcustomeraccount/updateAccountType',
    method: 'post',
    data: data
  })
}
// 导出对账单明细
export function exportBizCustomerAccountDetail (data) {
  return request({
    url: '/biz/bizcustomeraccount/export?accountCode=' + data.accountCode,
    method: 'get',
  })
}

// 导出对账单明细
export function exportExcelBizCustomerAccountDetail (data) {
  return request({
    url: '/biz/bizcustomeraccount/exportExcel?accountCode=' + data.accountCode,
    method: 'get',
  })
}
// 导出应收账款明细
export function payableDetailExportExcel (data) {
  return request({
    url: `/biz/bizcustomerpayable/detailExportExcel?ids=${data.ids}&customerName=${data.customerName}`,
    method: 'get',
  })
}

